//
//  FFMoviePlayerDelegate.h
//  FFMovieFoundation
//
//  Created by xb on 4/30/14.
//  Copyright (c) 2014 xb. All rights reserved.
//
#import "FFCommonDefines.h"
#import <Foundation/Foundation.h>

@class FFMediaPlayer;

@protocol FFMediaStreamRef <NSObject>
@required
- (struct FFMediaStream*)ffMediaStream;
@end

/**
 * Media player delegate.
 */
@protocol FFMediaPlayerDelegate <NSObject>

@required
/**
 * Called when the player prepared.
 *
 * @param player The shared media player instance.
 * @param arg Not use.
 */
- (void)mediaPlayer:(FFMediaPlayer *)player didPrepared:(id)arg;

/**
 * Called when the player playback completed.
 *
 * @param player The shared media player instance.
 * @param arg Not use.
 */
- (void)mediaPlayer:(FFMediaPlayer *)player playbackComplete:(id)arg;

/**
 * Called when the player have error occur.
 *
 * @param player The shared media player instance.
 * @param arg Contain the detail error information.
 */
- (void)mediaPlayer:(FFMediaPlayer *)player error:(id)arg;

@optional

/**
 * Called when the player buffering start.
 *
 * @param player The shared media player instance.
 * @param type FIRST/SEEK/INTERUPT
 * @param arg Not use.
 */
- (void)mediaPlayer:(FFMediaPlayer *)player bufferingType:(NSInteger)type bufferingStart:(id)arg;

/**
 * Called when the player buffering end.
 *
 * @param player The shared media player instance.
 * @param type FIRST/SEEK/INTERUPT
 * @param arg Not use.
 */
- (void)mediaPlayer:(FFMediaPlayer *)player bufferingType:(NSInteger)type bufferingEnd:(id)arg;

/**
 * Called when the player buffering
 *
 * @param player The shared media player instance.
 * @param bufferProgress
 */
- (void)mediaPlayer:(FFMediaPlayer *)player bufferProgress:(NSInteger)bufferProgress;

/**
 * Called when set the got the video size
 *
 * @param player The shared media player instance.
 * @param arg *NSArray* type. obj 0 *NSNubmer* type *int* value width of the video
 *                            obj 1 *NSNubmer* type *int* value height of the video
 */
- (void)mediaPlayer:(FFMediaPlayer *)player videoSizeChanged:(id)arg;

@end
